package top.market.model.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 登录日志
 * </p>
 *
 * @author li yuhai
 * @since 2025-03-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("login_log")
public class LoginLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名称
     */
    @TableField("username")
    private String username;

    /**
     * ip
     */
    @TableField("ip")
    private String ip;

    /**
     * ip来源
     */
    @TableField("ip_source")
    private String ipSource;

    /**
     * 操作系统
     */
    @TableField("os")
    private String os;

    /**
     * 浏览器
     */
    @TableField("browser")
    private String browser;

    /**
     * 登录状态
     */
    @TableField("status")
    private Boolean status;

    /**
     * 操作描述
     */
    @TableField("description")
    private String description;

    /**
     * user-agent用户代理
     */
    @TableField("user_agent")
    private String userAgent;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;


    public static final String ID = "id";

    public static final String USERNAME = "username";

    public static final String IP = "ip";

    public static final String IP_SOURCE = "ip_source";

    public static final String OS = "os";

    public static final String BROWSER = "browser";

    public static final String STATUS = "status";

    public static final String DESCRIPTION = "description";

    public static final String USER_AGENT = "user_agent";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

}
